import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
testCase = "DBshop018_商品管理商品属性删除属性分组"

# 进入dbshop后台
driver=openBrowser(urlAdmin)
#登录
DBshopLoginAdmin(driver)
time.sleep(3)

#进入商品管理-商品属性-属性分组
DBshopEnterMenu3(driver,'商品管理','商品属性','属性分组')

# 1.点击“删除”按钮，确认删除，删除成功。
driver.find_element_by_xpath('//td[text()="好好学习"]/following-sibling::td[2]/a[2]').click()
# firefox.switch_to.dert.accept()
driver.switch_to.alert.accept()
time.sleep(5)

# 断言
try:
    driver.find_element_by_xpath('//td[text()="好好学习"]').is_displayed()
    writeLog("%s 测试失败"%testCase)
    getPhoto(firefox)
except:
    writeLog("%s 测试通过" % testCase)
driver.quit()

